package com.nf.health.app.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;

import com.nf.health.app.R;
import com.nf.health.app.activity.global.MainActivity;
import com.nf.health.app.utils.ActivityUtils;
import com.nf.health.app.utils.PreferenceHelper;
import com.nf.health.app.utils.ViewUtil;

public class WelcomeThreeFragment  extends Fragment{
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
							 Bundle savedInstanceState) {
//		view.setOnClickListener(new OnClickListener() {
//			
//			@Override
//			public void onClick(View v) {
//				Intent heightIntent = new Intent(getActivity(),RegisterNickActivity.class);
//				heightIntent.putExtra("type", "0");
//				startActivity(heightIntent);
//				getActivity().finish();				
//			}
//		});



		return inflater.inflate(R.layout.fragment_welcomethree, container,false);
	}
	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		View btn_enter = ViewUtil.getView(getView(), R.id.btn_enter);
//		View btn_login = ViewUtil.getView(getView(), R.id.btn_login);


//		btn_login.setOnClickListener(new OnClickListener() {//login
//
//			@Override
//			public void onClick(View v) {
////				if(cb_protocol.isChecked()){
//					PreferenceHelper.putBoolean("IS_FIRST_TIME", true);
//					ActivityUtils.showActivity(getActivity(), LoginActivity.class);
////				}else{
////					Toast.makeText(getActivity(), "您没有同意服务条款", Toast.LENGTH_SHORT).show();
////				}
//			}
//		});
		btn_enter.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
//				if(cb_protocol.isChecked()){
				PreferenceHelper.putBoolean("IS_FIRST_TIME", true);
				ActivityUtils.skipActivity(getActivity(),MainActivity.class);
//					Bundle bundle = new Bundle();
//					bundle.putString("type", "0");
//					ActivityUtils.skipActivity(getActivity(), RegisterNickActivity.class, bundle);
//				}else{
//					Toast.makeText(getActivity(), "您没有同意服务条款", Toast.LENGTH_SHORT).show();
//				}
			}
		});

	}

}
